To improve network deployment flexibility and manageability, an SDN (Software Defined Networking, software-defined networking)-based network implementation manner is widely used. In SDN, a control function and a forwarding function of a network element are decoupled, and a network element in a network is divided into two parts: a control plane and a forwarding plane. Quality of a link between the control plane and the forwarding plane or between network elements of the forwarding plane directly affects quality of a network transmission service, for example, link connectivity, bandwidth, a packet loss rate, a delay, jitter, and the like affect quality of a network transmission service. Therefore, an SDN-based link quality detection method is of great significance.
The OpenFlow (OpenFlow) protocol is currently a main control protocol between the control plane and the forwarding plane in SDN. In the OpenFlow protocol, a control plane network element is referred to as an OpenFlow Controller (OpenFlow controller, hereinafter referred to as controller), and a forwarding plane network element is referred to as an OpenFlow Switch (OpenFlow switch, hereinafter referred to as switch). In a related technology, during implementation of SDN-based link quality detection, a switch generally detects link quality with reference to a network technology of the switch and by using a link quality detection protocol corresponding to the network technology, and reports a detection result to a controller or provides a detection result to a controller for querying. For example, if the network technology of the switch is an Ethernet technology, the switch detects link quality by using an Ethernet link detection protocol, and reports a detection result to the controller or provides a detection result to the controller for querying. Because different network technologies correspond to different link detection protocols, the switch needs to implement different link quality detection protocols, and then report a detection result to the controller or provides a detection result to the controller for querying. BFD (Bidirectional Forwarding Detection, bidirectional forwarding detection) is used as an example. BFD mainly implements detection of link connectivity, and both two switches at two ends of a link need to implement a BFD protocol stack, maintain a state machine, and send a packet to each other according to a BFD protocol, to detect link connectivity.
The prior art has the following disadvantages:
In the related technology, because the switch needs to use different link quality detection protocols to detect link quality for different network technologies, the switch needs to implement multiple link quality detection protocols; therefore, device complexity of the switch is increased. In addition, different link quality detection protocols are generally used to detect different kinds of content, for example, some are used to detect connectivity, and some are used to detect a delay. The link quality detection protocols vary in function. Therefore, link quality detection manners vary, and if different kinds of content need to be detected, the switch needs to implement multiple link quality detection protocols, and operations are complex. Moreover, in this manner, because there is a large quantity of interface messages between the controller and the switch, the controller needs to query link quality from multiple switches, or multiple switches need to report link quality; therefore, interaction between the controller and the switch is increased, and network service processing efficiency is affected. In addition, when implementing a link quality detection protocol, the switch generally needs to maintain a state machine; therefore, implementation of the switch is complex.